﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/MasterPage.Master" CodeBehind="List.aspx.vb" Inherits="RUHResturants.List" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        <div class="HeaderFont">List of Resturants:</div>
        <br />
    <asp:GridView ID="GridView1" runat="server" AllowSorting="True" 
    AutoGenerateColumns="False" DataSourceID="SqlDataSource1" 
            CssClass="ListBorder" CellPadding="4" ForeColor="#333333" GridLines="None">
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <Columns>
            <asp:BoundField DataField="RestName" HeaderText="Name" 
                SortExpression="RestName" />
            <asp:BoundField DataField="PriceLevel" HeaderText="Price Level" 
                SortExpression="PriceLevel" />
            <asp:BoundField DataField="LuxuryLevel" HeaderText="Luxury Level" 
                SortExpression="LuxuryLevel" />
            <asp:BoundField DataField="WorkingHours" HeaderText="Working Hours" 
                SortExpression="WorkingHours" />
            <asp:BoundField DataField="FoodType" HeaderText="Food Type" 
                SortExpression="FoodType" />
            <asp:TemplateField HeaderText="Image" SortExpression="ImgName">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("ImgName") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("ImgName", "RestImages/{0}") %>' Height="85" Width="80" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField ShowHeader="False">
                <ItemTemplate>
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("column1", "Details.aspx?Id={0}") %>' 
                        Text="Details"></asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        <HeaderStyle BackColor="#fcfbfa" Font-Bold="True" ForeColor="#444444" />
        <EditRowStyle BackColor="#999999" />
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
    </asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
    ConnectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\RUHRestaurantsDB.accdb;" 
    ProviderName="System.Data.OleDb" 
    
            SelectCommand="SELECT [Resturants.Id] AS column1, [RestName], [PriceLevel], [LuxuryLevel], [WorkingHours], [ImgName], [FoodType] FROM [ResturantsDetails]"></asp:SqlDataSource>
</asp:Content>
